<?php

namespace App\Supports;

class Error
{

    protected int $code;

    protected string $message;

    /**
     * get code.
     *
     * @return int
     */
    public function getCode(): int
    {
        return $this->code;
    }


    /**
     * get message.
     *
     * @return string
     */
    public function getMessage(): string
    {
        return $this->message;
    }

    /**
     * set code & msg
     *
     * @param int $code
     * @param string|null $message
     * @return void
     */
    public function set(int $code, string $message = null): void
    {
        $this->message = $message;
        $this->code = $code;
    }
}
